let express = require('express');
let Router = express.Router();
module.exports = Router;

let query = require('./db');
// http://localhost:9090/api/city/citylist
Router.get('/citylist', async (req, res) => {
    try {
        let data = await query('select * from city;');
        res.send({
            code: 200,
            msg: '请求成功',
            data,
        })
    } catch (err) {
        res.send({
            code: 400,
            msg: '查询错误',
            msg:err
        })
    }
})